<template>
  <view>
    <view class="nav"></view>
    <view class="top">
      <view class="user" @click="login">
        <view class="bigText">
          未登录/注册
        </view>
        <view class="smallText">
          点击头像可登录/注册
        </view>
      </view>
    </view>
    <view class="grid">
      <grid-item v-for="item in gridList" :key="item.id" :className="item.class" :title="item.title"></grid-item>
    </view>
    <view class="assistant">
      <view class="title">
        <view>求职助手</view>
        <text>更多<text class="iconfont icon-right"></text></text>
      </view>
      <view class="items">
        <view class="item">
          <view class="left">
            <view class="bigText">
              简历刷新
            </view>
            <view class="smallText">
              提升简历活跃
            </view>
          </view>
          <view class="right">
            <view class="iconfont icon-jlsx"></view>
          </view>
        </view>
        <view class="item">
          <view class="left">
            <view class="bigText">
              职业测评
            </view>
            <view class="smallText">
              帮助职业定位
            </view>
          </view>
          <view class="right bgCD95FE">
            <view class="iconfont icon-zycp"></view>
          </view>
        </view>
      </view>
    </view>
    <view class="list">
      <view class="item" hover-class="active" v-for="item in listOne" :key='item.icon'>
        <view class="item-inner">
          <view :class="item.icon">
            <text>{{item.title}}</text>
          </view>
          <text class="iconfont icon-right"></text>
        </view>
      </view>
      <view class="line"></view>
      <view class="item" hover-class="active" v-for="item in listTwe" :key='item.icon'>
        <view class="item-inner">
          <view :class="item.icon">
            <text>{{item.title}}</text>
          </view>
          <text class="iconfont icon-right"></text>
        </view>
      </view>
    </view>
    <view class="footer">
      <view class="item">
        客服电话：17361398280 工作时间：9:30-18:30
      </view>
      <view class="item">
        老年人直连热线：17361398280 工作时间：9:30-18:30
      </view>
      <view class="item">
        人力资源许可证|营业执照
      </view>
      <view class="item">
        朝阳区人社局监督电话：17361398280，(17361398280)
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        gridList: [{
            id: 1,
            class: 'iconfont icon-resume',
            title: '在线简历'
          },
          {
            id: 2,
            class: 'iconfont icon-upLoad',
            title: '附件简历'
          },
          {
            id: 3,
            class: 'iconfont icon-wdms',
            title: '我的面试'
          },
          {
            id: 4,
            class: 'iconfont icon-jobSub',
            title: '职位订阅'
          }
        ],
        listOne: [{
            title: "我的收藏",
            icon: 'iconfont icon-shoucang'
          },
          {
            title: "我的发现",
            icon: 'iconfont icon-wdfx'
          },
          {
            title: "隐私设置",
            icon: 'iconfont icon-xianshi'
          },
        ],
        listTwe: [
          {
            title: "我要招聘",
            icon: 'iconfont icon-wyzp'
          },
          {
            title: "直直公益",
            icon: 'iconfont icon-gongyi'
          },
          {
            title: "意见反馈",
            icon: 'iconfont icon-yijian'
          },
        ]
      }
    },
    methods: {
      login() {
        uni.login({
          provider: 'weixin',
          success: function(loginRes) {
            // 登录成功
            uni.getUserInfo({
              provider: 'weixin',
              success: function(info) {
                // 获取用户信息成功, info.authResult保存用户信息
                console.log(info)
              }
            })
          },
          fail: function(err) {
            // 登录授权失败  
            // err.code是错误码
            console.log(err)
          }
        })
      }
    }
  }
</script>

<style lang="scss">
  .nav {
    width: 750rpx;
    height: 146rpx;
    background: $uni-color-primary;
    position: fixed;
    top: var(--window-top);
    left: 0;
    z-index: 2;
  }
  .top {
    height: 224rpx;
    padding-top: 146rpx;
    background: $uni-color-primary;

    .user {
      transform: translateY(64rpx);
      width: 710rpx;
      margin: auto;
      color: $uni-text-color-inverse;

      .bigText {
        font-size: 54rpx;
      }

      .smallText {
        font-size: 30rpx;
      }
    }
  }

  .grid {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 214rpx;
    background: $uni-bg-color;
  }

  .assistant {
    .title {
      width: 670rpx;
      display: flex;
      margin: auto;
      justify-content: space-between;
      align-items: center;

      view {
        font-size: 40rpx;
        font-weight: bold;
      }

      text {
        color: $uni-text-color-grey;
        font-size: 30rpx;
      }
    }

    .items {
      width: 670rpx;
      margin: auto;
      margin-top: 40rpx;
      display: flex;
      justify-content: space-between;

      .item {
        width: 264rpx;
        padding: 0 30rpx;
        height: 140rpx;
        box-shadow: 2rpx 2rpx 30rpx 1rpx #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: 10rpx;

        .bigText {
          font-size: 40rpx;
          font-weight: bold;
        }

        .smallText {
          font-size: 24rpx;
          color: $uni-text-color-grey;
        }

        .right {
          width: 78rpx;
          height: 78rpx;
          background: #81AFE6;
          border-radius: 24rpx;
          line-height: 78rpx;
          text-align: center;
          color: $uni-text-color-inverse;

          .iconfont {
            font-size: 50rpx;
          }
        }

        .bgCD95FE {
          background: #CD95FE;
        }
      }
    }
  }

  .list {
    margin-top: 40rpx;

    .item {
      .item-inner {
        width: 670rpx;
        height: 108rpx;
        line-height: 108rpx;
        display: flex;
        margin: auto;
        justify-content: space-between;

        text {
          margin-left: 30rpx;
          font-size: 34rpx;
          color: $uni-text-color;
        }

        .iconfont {
          font-size: 40rpx;
          color: $uni-text-color;
        }

        .icon-right {
          color: $uni-text-color-grey;
        }
      }
    }

    .active {
      background: #F7F7F7;
    }

    .line {
      width: 670rpx;
      height: 1rpx;
      margin: 24rpx auto;
      background: $uni-bg-color-grey;
    }
  }
  .footer {
    margin-top: 108rpx;
    padding-bottom: 64rpx;
    .item {
      text-align: center;
      color: $uni-text-color-grey;
      font-size: 26rpx;
      margin-bottom: 14rpx;
    }
  }
</style>
